package game;

import java.awt.Image;
import java.awt.Toolkit;
import java.net.URL;

public class LoadImages
{
	static Image[] images;
	static LoadImages instance;
	static String[] stImages = new String[]{ 
		"/images/btIniciar.png",//	0 - Imagem exemplo
		"/images/btCreditos.png",//	1
		"/images/btSobre.png",//	2
		"/images/SetaCima.png",//	3
		"/images/SetaBaixo.png",//	4
		"/images/menu.png",//	5
		"/images/instrucoes.png",//	6
		"/images/creditos.png",//	7
		"/images/sobre.png",//	8
		"/images/FundoLevel.jpg",//9
		"/images/playerbg.png",//10
		"/images/slotbg.png",//11
		"/images/slotbghover.png",//12
		"/images/level.png",//13
		"/images/tecnico.png",//14
		"/images/antena.png",//15
		"/images/poste.png",//16
		"/images/moneySlot.png",//17
		"/images/money.png",//18
		"/images/timeBox.png",//19
		"/images/green.png",//20
		"/images/yellow.png",//21
		"/images/red.png",//22
		"/images/hud01.png",//23
		"/images/hud02.png",//24
		"/images/trabalhador.png",//25
		"/images/dinheiro.png",//26
		"/images/tecnicohover.png",//27
		"/images/antenahover.png",//28
		"/images/postehover.png",//29
		"/images/funcionarios.png",//30
		"/images/caixadialogo.png",//31
		"/images/caixadialogo2.png",//32
		"/images/caixadialogo3.png",//33
		"/images/caixadialogo4.png",//34
		"/images/caixadialogo5.png",//35
		"/images/caixadialogo6.png",//36
		"/images/caixadialogo7.png",//37
		"/images/caixadialogo8.png",//38
		"/images/caixadialogo9.png",//39
		"/images/camUp.png",//40
		"/images/camRight.png",//41
		"/images/camLeft.png",//42
		"/images/camDown.png",//43
		"/images/instrucoes2.png",//44
		"/images/avancar.png",//45
		"/images/voltar.png",//46
		"/images/AlertaVerde.png",//47
		"/images/AlertaAmarelo.png",//48
		"/images/AlertaVermelho.png",//49
		"/images/Casa 1.png",//50
		"/images/Casa 2.png",//51
		"/images/Casa 3.png",//52
		"/images/Casa 4.png",//53
		"/images/Casa 5.png",//54
		"/images/Casa 6.png",//55
		"/images/Casa 7.png",//56
		"/images/Casa 8.png",//57
		"/images/Casa 9.png",//58
		"/images/Casa 10.png",//59
		"/images/Casa 11.png",//60
		"/images/Casa 12.png",//61
		"/images/Casa 13.png",//62
		"/images/Casa 14.png",//63
		"/images/Casa 15.png",//64
		"/images/Casa 16.png",//65
		"/images/Casa 17.png",//66
		"/images/Casa 18.png",//67
		"/images/Casa 19.png",//68
		"/images/Casa 20.png",//69
		"/images/Casa 21.png",//70
		"/images/Casa 22.png",//71
		"/images/Casa 23.png",//72
		"/images/Casa 24.png",//73
		"/images/Casa 25.png",//74
		"/images/Casa 26.png",	//75
		"/images/Casa 27.png",//76
		"/images/Casa 28.png",//77
		"/images/Casa 29.png",//78
		"/images/Casa 30.png",//79
		"/images/Casa 31.png",//80
		"/images/Casa 32.png",//81
		"/images/Casa 33.png",//82
		"/images/Casa 34.png",//83
		"/images/Casa 35.png",//84
		"/images/Casa 36.png",//85
		"/images/Casa 37.png",//86
		"/images/Casa 38.png",//87
		"/images/Torre.png",//88/
		"/images/M.png",//89
		};
	
	public void Load()
	{
		Toolkit tk = Toolkit.getDefaultToolkit();
		
		images = new Image[stImages.length];
		
		for(int i = 0; i < stImages.length; i++)
		{
			System.out.println(i);
			images[i] = tk.getImage(getURL(stImages[i]));
		}
	}
	private LoadImages(){}
	
	public static LoadImages getInstance(){
		if(instance == null)
			instance = new LoadImages();
		
		return instance;
	}
	
	private static URL getURL(String filename)
	{
		URL url = null;
		try
		{
			url = LoadImages.getInstance().getClass().getResource(filename);
		}
		catch (Exception e) { }
		return url;
	}
	
	public static Image getImage(int index)
	{
		return images[index];
	}
	
}